package com.mowh.multithreading.thread.per.message;

/**
 * @author mowh1gd
 * @create 2023/11/23 11:00
 */
public class RunnableHost {
    private final Helper helper = new Helper();
    public void request(final int count, final char c) {
        System.out.println("    request(" + count + ", " + c + ")  BEGIN");
        new Thread(
                new Runnable() {//通过java.lang.Runnable作为Thread构造函数的参数来显式创建线程，Runnable的run方法体内是工作内容
                    @Override
                    public void run() {
                        helper.handle(count, c);
                    }//工作内容
                }
        ).start();
        System.out.println("    request(" + count + ", " + c + ")  END");
    }
}
